package com.tepth.busfix.main.repair.complete;

import com.tepth.busfix.network.ApiModel;
import com.tepth.busfix.network.observer.SimpleDisposableObserver;

/**
 * Created by TMVPHelper on 2017/03/15
 */
public class CompletePunchCardPresenter extends CompletePunchCardContract.Presenter {

    @Override
    public void postRepair() {
        mRxManager.add(mModel.postRepair(mView.getAuthKey(), mView.getRepairInfo())
                .subscribeWith(new SimpleDisposableObserver<ApiModel<String>>(mView) {
                    @Override
                    public void onSucceed(Object o) {
                        mView.postRepairInfoSucceed();
                    }
                }));
    }

    @Override
    public void postRework() {
        mRxManager.add(mModel.postRework(mView.getAuthKey(), mView.getRepairInfo())
                .subscribeWith(new SimpleDisposableObserver<ApiModel<String>>(mView) {
                    @Override
                    public void onSucceed(Object o) {
                        mView.postReworkSucceed();
                    }
                }));
    }
}